$(function(){
	$("input").focus(function(){
		$(this).css("opacity","0.8");
		$(this).css("color","#000000");
	}).blur(function(){
		$(this).css("opacity","1");
		$(this).css("color","#EEEFED");
	});
	$(".sou").hover(function(){
		$(".chax").css("display","block");
	},function(){
		$(".chax").css("display","none");
	})
});

//原生JS
window.onload = function(){
	
	var left_column = document.getElementsByClassName("left-column")[0];
	var li = left_column.getElementsByTagName("li");
	var html_css = document.getElementsByClassName("HTML-CSS")[0];
	var JavaScript = document.getElementsByClassName("JavaScript")[0];
	var HTMLCSS_li = html_css.getElementsByTagName("li");
	var JavaScript_li = JavaScript.getElementsByTagName("li");
	var HTMLCSS_a = html_css.getElementsByTagName("a");
	var JavaScript_a = JavaScript.getElementsByTagName("a");
	var middle = document.getElementsByClassName("middle-column-home")[0];
	var Input = document.getElementsByClassName("Input")[0];
	var back = document.getElementsByClassName("back")[0];
	var HTMLCSSarr = ["HTML","HTML5","CSS","CSS3","Bootstrap3","Bootstrap4","Font Awesome","Foundation"];
	var JavaScriptarr = ["JavaScript","HTML DOM","jQuery","AngularJS","AngularJS2","Vue.js","React","jQuery UI","jQuery EasyUI","Node.js","AJAX","JSON","Highcharts","Google 地图"];
	fun();
	
	for (var i = 0;i<li.length;i++) {
		if(i %2 ==0){
			li[i].style.backgroundColor="#FBFBFB";
		}else{
			li[i].style.backgroundColor="#FFF";
		}
		if(i == 0){
			li[0].style.backgroundColor="#EEEEEE";
		}
	}

	window.onresize=function(){
		fun();
	}

	function fun(){
		if(screen.availWidth <= 519){
			html_css.style.minHeight = "152px";
			JavaScript.style.minHeight = "300px";
			Input.style.display = "none";
			for (var i = 0;i<HTMLCSS_li.length;i++) {
				HTMLCSS_li[i].innerText = HTMLCSSarr[i];
				HTMLCSS_li[i].style.cssText = "width:100%; height:40px; padding:0px; color:#64854C; font-size:13px; text-align:center; line-height:40px; font-weight:700;";
				HTMLCSS_li[i].style.fontFamily = "Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Noto Sans CJK SC,WenQuanYi Micro Hei,Arial,sans-serif";
				HTMLCSS_a[i].style.cssText = "width:28%; height:40px; padding:0px;"
			}
			
			for (var i = 0;i<JavaScript_li.length;i++) {
				JavaScript_li[i].innerText = JavaScriptarr[i];
				JavaScript_li[i].style.cssText = "width:100%; height:40px; padding:0px; color:#64854C; font-size:13px; text-align:center; line-height:40px; font-weight:700;";
				JavaScript_li[i].style.fontFamily = "Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Noto Sans CJK SC,WenQuanYi Micro Hei,Arial,sans-serif";
				JavaScript_a[i].style.cssText = "width:28%; height:40px; padding:0px;"
			}
		}
		else{
			
		}
	}
	
	window.onscroll=function(){
		
		if(window.scrollY > 80){
			back.style.cssText="visibility: visible;";
		}else{
			back.style.cssText="visibility: hidden;";
		}
	}
	console.log(screen.availWidth);
	console.log(html_css);
	console.log(HTMLCSS_li);
	console.log(window.scrollY);
}
